<template>
	<view class="">
		<view class="paihang">
			<goodsSwiper :datas="detail" :config="config" @change="swiperChange" @tapFun="tapFun"></goodsSwiper>
		</view>
		
		<!-- 广告图 -->
		<view style="width: 100%;height: 10vh;margin-top: 14px;" class="">
			<img style="width: 100%;height: 100%;border-radius: 15px;"
				src="https://img1.baidu.com/it/u=1176362935,1432244848&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1706547600&t=cc073152959dc4074d0ebeb151da4c2e"
				alt="">
		</view>
		
		<view  v-for="(topicSku,indexa) in splicingOrdersSkuList" :key="indexa" class="" style="margin-top: 10px;">
			<marketItem :topicSku="topicSku"></marketItem>
		</view>
	</view>
	
</template>

<script>
	import marketItem from '../components/marketItem.vue'
	import goodsSwiper from '../../../components/pyh-goodsSwiper/pyh-goodsSwiper.vue'
	export default{
		data(){
			return{
				splicingOrdersSkuList:[],
				current: 0,
				pages: 1,
				detail:{
					title:"火拼榜",
					subLable:"全网值得拼的都在这里~",
					list:[
						{
							id:1,
							name:'会复发和',
							img:"https://img1.baidu.com/it/u=525857817,4009704940&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=750"},
						{
							id:2,
							name:'我是id2',
							img:"https://img2.baidu.com/it/u=3881313606,2790146805&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500"},
						{
							id:3,
							name:'方法胡id3',
							img:"https://img2.baidu.com/it/u=3780033392,4206444395&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=666"},
						{
							id:4,
							name:'方法胡id4',
							img:"https://img1.baidu.com/it/u=706530165,64017581&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=727"},
						{
							id:5,
							name:'会复发和id5',
							img:"https://img0.baidu.com/it/u=2000958276,2625483946&fm=253&fmt=auto&app=138&f=JPEG?w=342&h=608"},
					],
				},
				config:{
				
					autoplay:"true",
					hideMargin:"true",
					circular:"true" 
				}
			}
		},
		mounted() {
			
			this.getSplicingOrdersSkuList()
		},
		components:{
			marketItem,
			goodsSwiper
		},
		methods:{
			swiperChange(){
				
			},
			async getSplicingOrdersSkuList() {
				if (this.current < this.pages) {
					this.current++
					console.log(this.current);
					let form = {
						current: this.current,
						size: 3,
						source: 1
					}
			
					let result = await this.$u.api.getTopicSku(form);
			
			
					this.pages = result.pages
			
					this.splicingOrdersSkuList = this.splicingOrdersSkuList.concat(result.records);
				
			
			
				} else {
					console.log("没有数据了");
				}
			
			
			}
		}
	}
</script>

<style>
</style>